package com.example.springboot.mapper;

import com.example.springboot.entity.Department;
import com.example.springboot.entity.Employee;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Mapper
@Repository
public interface EmployeeMapper {

//    private static Map<Integer, Employee> employees = null;


    //    static{
//        employees = new HashMap<Integer, Employee>();
//
//        employees.put(1001, new Employee(1001, "E-AA", "aa@163.com", 1, new Department(101, "D-AA")));
//        employees.put(1002, new Employee(1002, "E-BB", "bb@163.com", 1, new Department(102, "D-BB")));
//        employees.put(1003, new Employee(1003, "E-CC", "cc@163.com", 0, new Department(103, "D-CC")));
//        employees.put(1004, new Employee(1004, "E-DD", "dd@163.com", 0, new Department(104, "D-DD")));
//        employees.put(1005, new Employee(1005, "E-EE", "ee@163.com", 1, new Department(105, "D-EE")));
//    }

    public void add(Employee e);

    //查询所有员工
    public List<Employee> getAll();

    public void update(Employee e);

    public Employee get(Integer id);

    public void delete(Integer id);
}
